USE [NANS21V]
GO

/****** オブジェクト: SqlProcedure [dbo].[TaikouRekidai] スクリプト日付: 2014/05/16 16:57:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TaikouRekidai]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[TaikouRekidai]
GO

CREATE PROCEDURE [dbo].[TaikouRekidai]
	@TAIKAINO int,
	@KYOGINO int
AS
	SELECT 
		TK.KYOGINO, 
		TK.SYUMOKUNO, 
		TK.SEIBETUNO,
		 TK.KYOGIMEI, 
		 TK.KYOGIKANA, 
		 TSM.SYUMOKUMEI, 
		 TSM.SYUMOKUKANA, 
		 TSM.KIROKUKUBUN, 
		 TSM.SYUMOKUKUBUN 
	 FROM 
		 TBL_KYOGI AS TK, 
		 TBL_SYUMOKU_MASTER AS TSM 
	 WHERE 
		 TK.TAIKAINO = @TAIKAINO 
		 AND TK.KYOGINO = @KYOGINO 
		 AND TK.SYUMOKUNO = TSM.SYUMOKUNO